describe 'checkin statuses'
		
	before_each
		checkinStatuses = new CheckinStatuses();
	end
	
	it 'should not show undefined user'
		checkinStatuses.addCheckin("2010-11-10", "veryfaint@gmail.com");
		checkinStatuses.addCheckin("2010-11-10", undefined);
		checkinStatuses.addCheckin("2010-11-10", "taiyumenle@gmail.com");
		
		checkinStatuses.getCheckins()["2010-11-10"][0].getName().should.be("veryfaint@gmail.com");
		checkinStatuses.getCheckins()["2010-11-10"][1].getName().should.be("taiyumenle@gmail.com");
	end
	
	it 'should show submitter and his checkin count in 1 day'
		checkinStatuses.addCheckin("2010-11-10", "veryfaint@gmail.com");
		checkinStatuses.addCheckin("2010-11-10", "veryfaint@gmail.com");
		
		checkinStatuses.getCheckins()["2010-11-10"][0].getName().should.be("veryfaint@gmail.com");
		checkinStatuses.getCheckins()["2010-11-10"][0].getCheckinCount().should.be(2);
	end
	
	it 'should show submitter and his checkin count in 2 days'
		checkinStatuses.addCheckin("2010-11-10", "veryfaint@gmail.com");
		checkinStatuses.addCheckin("2010-11-10", "veryfaint@gmail.com");
		checkinStatuses.addCheckin("2010-11-10", "veryfaint@gmail.com");
		checkinStatuses.addCheckin("2010-11-11", "lijian@gmail.com");
		checkinStatuses.addCheckin("2010-11-11", "veryfaint@gmail.com");
		checkinStatuses.addCheckin("2010-11-11", "veryfaint@gmail.com");
		
		checkinStatuses.getCheckins()["2010-11-10"][0].getName().should.be("veryfaint@gmail.com");
		checkinStatuses.getCheckins()["2010-11-10"][0].getCheckinCount().should.be(3);
		
		checkinStatuses.getCheckins()["2010-11-11"][0].getName().should.be("lijian@gmail.com");
		checkinStatuses.getCheckins()["2010-11-11"][0].getCheckinCount().should.be(1);
		checkinStatuses.getCheckins()["2010-11-11"][1].getName().should.be("veryfaint@gmail.com");
		checkinStatuses.getCheckins()["2010-11-11"][1].getCheckinCount().should.be(2);
	end
	
	it 'should sort the submitters by date'
		checkinStatuses.addCheckin("2010-11-10", "submitter10");
		checkinStatuses.addCheckin("2010-11-12", "submitter12");
		checkinStatuses.addCheckin("2010-11-11", "submitter11");
		
		var submitters = [];
		var checkins = checkinStatuses.getCheckins();
		
		for(checkinDate in checkins){
			submitters.push(checkins[checkinDate][0]);
		}
		
		submitters[0].getName().should.be("submitter12");
		submitters[1].getName().should.be("submitter11");
		submitters[2].getName().should.be("submitter10");
	end
end